package proxy; /**
 * Copyright (C), 2015-2018, 北京译泰教育科技有限公司
 * FileName: HelloProxy
 * Author:   andy
 * Date:     18/1/30 下午5:12
 * Description: ${DESCRIPTION}
 * History:
 */

/**
 * 〈一句话功能简述〉<br>
 *
 * @author andy
 * @version V1.0
 * @date 18/1/30 下午5:12
 */
public class HelloProxy implements Hello {

    private Hello hello;

    public HelloProxy() {
        hello = new HelloImpl();
    }

    private void before(){
        System.out.println("before：" + System.currentTimeMillis());
    }

    private void after(){
        System.out.println("after：" + System.currentTimeMillis());
    }

    @Override
    public void say() {
        before();
        hello.say();
        after();
    }

    public static void main(String[] args) {
        Hello hello = new HelloProxy();
        hello.say();
    }
}
